//
//  Kylin_MyLotteryViewController.m
//  01-LotteryBaseFrame
//
//  Created by Kylin on 16/1/4.
//  Copyright © 2016年 kylin. All rights reserved.
//

#import "Kylin_MyLotteryViewController.h"
#import "Kylin_SettingTableViewController.h"

@interface Kylin_MyLotteryViewController ()
@property (weak, nonatomic) IBOutlet UIButton *loginBtn;

@end

@implementation Kylin_MyLotteryViewController

- (void)dealloc{
    
    NSLog(@"%s",__func__);
    
    
}
- (void)viewDidLoad {
    [super viewDidLoad];
  
    // 1:拉伸图片
    UIImage *image = self.loginBtn.currentBackgroundImage;
    // button 的拉伸只能通过代码来实现, 从中心点拉伸
    image = [image stretchableImageWithLeftCapWidth:image.size.width * 0.5 topCapHeight:image.size.height * 0.5];
    
    [self.loginBtn setBackgroundImage:image forState:UIControlStateNormal];
    
    // 设置导航条左侧按钮
    UIButton *button =[[UIButton alloc]init];
    [button setImage:[UIImage imageNamed:@"FBMM_Barbutton"] forState:UIControlStateNormal];
    [button setTitle:@"客服" forState:UIControlStateNormal];
    
    [button sizeToFit];
    
    // 设置左边buttonItem
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:button];
    
    
    // 设置导航条右侧按钮
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithImage:[UIImage imageWithRenderingImageName:@"Mylottery_config"] style:UIBarButtonItemStylePlain target:self action:@selector(rightButtonOnClick)];
    
    
}

- (void)rightButtonOnClick{
    
    Kylin_SettingTableViewController *setting = [[Kylin_SettingTableViewController alloc]init];
    
    [self.navigationController pushViewController:setting animated:YES];
    
}



@end
